#ifndef RESIZER_H
#define RESIZER_H

#include <QQueue>
#include <QString>

#include "ui_ui.h"

class QDragEnterEvent;
class QDragLeaveEvent;
class QDragMoveEvent;
class QDropEvent;
class QTimer;

class ImageResizer: public QMainWindow
{
	Q_OBJECT

public:
	ImageResizer(QWidget *parent = NULL);
	virtual ~ImageResizer();

public slots:
	void about();

protected:
	void dragEnterEvent(QDragEnterEvent *);
	void dragLeaveEvent(QDragLeaveEvent *);
	void dragMoveEvent(QDragMoveEvent *);
	void dropEvent(QDropEvent *);

protected slots:
	void loadSettings();
	void saveSettings();

	bool processPath(const QString &);

private:
	Ui::MainWindow *ui;
	QQueue<QString> queue;
	QTimer *timer;

private slots:
	void chooseDir();

	QString outputPath(const QString &) const;
	bool resizeAndSaveImage(const QString &, const QString &);

	void processQueue();

	void enableSavingSettings(bool);
	void enableAlwaysOnTop(bool);
};

#endif	// RESIZER_H
